/*
 * @Author: 徐建辰
 * @Date: 2021-11-03 16:34:05
 * @LastEditTime: 2021-11-04 17:27:27
 * @LastEditors: Please set LastEditors
 * @Description: 只看高铁动车
 */
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import './hignspeed.css'
function HignSpeed(props) {
  const {highSpeed, toggle} = props

  return (
    <div className="high-speed">
      <div className="high-speed-label">只看高铁/动车</div>
      <div className="high-speed-switch" onClick={() => toggle()}>
        <input type="hidden" name="highSpeed" value={highSpeed}/>
        <div className={classNames('high-speed-track', {checked: highSpeed})}>
          <span className={classNames('high-speed-handle', {checked: highSpeed})}></span>
        </div>
      </div>
    </div>
  )
}

HignSpeed.propTypes = {
  highSpeed: PropTypes.bool.isRequired,
  toggle: PropTypes.func.isRequired
}

export default HignSpeed
